<?php
	//数据库连接
	$dbhost = 'localhost:3306';  // mysql服务器主机地址
	$dbuser = 'root';            // mysql用户名
	$dbpass = '';          // mysql用户名密码
	$conn = mysqli_connect($dbhost, $dbuser, $dbpass);
	if(! $conn )
	{
	    die('Could not connect: ' . mysqli_error());
	}

    $search_input = $_GET['search_input'];

    mysqli_select_db( $conn, 'tmp' );  //选择数据库
	//数据库数据选择,读信息
	$sql = "DELETE FROM student WHERE id LIKE '$search_input%' OR name LIKE '%$search_input%'";

	$retval = mysqli_query( $conn, $sql ); 
	if(!$retval )
	{
	    die('无法删除学生: ' . mysqli_error($conn));
	}

    echo <<<STR
    <script>
        window.confirm("数据删除成功");
    </script>
    STR;
?>